package com.globalwave.eps.entity;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.globalwave.base.BaseEntity;

@Entity
@Table(name = "electricity_project_line")
public class ElectricityProjectLine extends BaseEntity implements Serializable  {

    @Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="increment")
    @GenericGenerator(name="electricity_project_line_SEQ", strategy = "increment")
    private Long id ;
     private Long project_id;
     private Long line_number;
     private String budget_staff_number;
     private Long plan_receive_on;
     private Long design_on;
     private Long device_quote_on;
     private String  device_provider ;
     private Long quote_receive_on;
     private Long complete_on;
     private Double high_voltage_budget;
     private Double low_voltage_budget;
     private Double soil_building_budget;
     private Double city_building_budget;
     private Double pipe_jacking_budget;
     private Double budget_total;
     private Long audit_on;
     private Long contract_on;
     private Long gather_on;
     private Long complete_percentage;
     private Double high_voltage_balance;
     private Long high_voltage_balance_on;
     private String high_voltage_team;
     private Double low_voltage_balance;
     private Long low_voltage_balance_on;
     private String low_voltage_team;
     private Double soil_building_balance;
     private Long soil_building_balance_on;
     private String soil_building_team;
     private Double city_building_balance;
     private Long city_building_balance_on;
     private String city_building_team;
     private Double pipe_jacking_balance;
     private Long pipe_jacking_balance_on;
     private String pipe_jacking_team;
     private Double balance_total;
     private String remark_;
     private Short progress_ ;
     private Double budget_total_diff ;
     
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public Long getProject_id() {
		return project_id;
	}
	public void setProject_id(Long project_id) {
		this.project_id = project_id;
	}
	public Long getLine_number() {
		return line_number;
	}
	public void setLine_number(Long line_number) {
		this.line_number = line_number;
	}
	public String getBudget_staff_number() {
		return budget_staff_number;
	}
	public void setBudget_staff_number(String budget_staff_number) {
		this.budget_staff_number = budget_staff_number;
	}
	public Long getPlan_receive_on() {
		return plan_receive_on;
	}
	public void setPlan_receive_on(Long plan_receive_on) {
		this.plan_receive_on = plan_receive_on;
	}
	public Long getDesign_on() {
		return design_on;
	}
	public void setDesign_on(Long design_on) {
		this.design_on = design_on;
	}
	public Long getDevice_quote_on() {
		return device_quote_on;
	}
	public void setDevice_quote_on(Long device_quote_on) {
		this.device_quote_on = device_quote_on;
	}
	public Long getQuote_receive_on() {
		return quote_receive_on;
	}
	public void setQuote_receive_on(Long quote_receive_on) {
		this.quote_receive_on = quote_receive_on;
	}
	public Long getComplete_on() {
		return complete_on;
	}
	public void setComplete_on(Long complete_on) {
		this.complete_on = complete_on;
	}
	public Double getHigh_voltage_budget() {
		return high_voltage_budget;
	}
	public void setHigh_voltage_budget(Double high_voltage_budget) {
		this.high_voltage_budget = high_voltage_budget;
	}
	public Double getLow_voltage_budget() {
		return low_voltage_budget;
	}
	public void setLow_voltage_budget(Double low_voltage_budget) {
		this.low_voltage_budget = low_voltage_budget;
	}
	public Double getSoil_building_budget() {
		return soil_building_budget;
	}
	public void setSoil_building_budget(Double soil_building_budget) {
		this.soil_building_budget = soil_building_budget;
	}
	public Double getCity_building_budget() {
		return city_building_budget;
	}
	public void setCity_building_budget(Double city_building_budget) {
		this.city_building_budget = city_building_budget;
	}
	public Double getPipe_jacking_budget() {
		return pipe_jacking_budget;
	}
	public void setPipe_jacking_budget(Double pipe_jacking_budget) {
		this.pipe_jacking_budget = pipe_jacking_budget;
	}
	public Double getBudget_total() {
		if (budget_total == null) {
			double h = high_voltage_budget == null?0:high_voltage_budget.doubleValue();
			double l = low_voltage_budget == null?0:low_voltage_budget.doubleValue();
			double s = soil_building_budget == null?0:soil_building_budget.doubleValue();
			double c = city_building_budget == null?0:city_building_budget.doubleValue();
			double p = pipe_jacking_budget == null?0:pipe_jacking_budget.doubleValue();
			
			return new Double(h + l + s + c + p) ;
		}
		return budget_total;
	}
	public void setBudget_total(Double budget_total) {
		this.budget_total = budget_total;
	}
	public Long getAudit_on() {
		return audit_on;
	}
	public void setAudit_on(Long audit_on) {
		this.audit_on = audit_on;
	}
	public Long getContract_on() {
		return contract_on;
	}
	public void setContract_on(Long contract_on) {
		this.contract_on = contract_on;
	}
	public Long getGather_on() {
		return gather_on;
	}
	public void setGather_on(Long gather_on) {
		this.gather_on = gather_on;
	}
	public Long getComplete_percentage() {
		return complete_percentage;
	}
	public void setComplete_percentage(Long complete_percentage) {
		this.complete_percentage = complete_percentage;
	}
	public Double getHigh_voltage_balance() {
		return high_voltage_balance;
	}
	public void setHigh_voltage_balance(Double high_voltage_balance) {
		this.high_voltage_balance = high_voltage_balance;
	}
	public Long getHigh_voltage_balance_on() {
		return high_voltage_balance_on;
	}
	public void setHigh_voltage_balance_on(Long high_voltage_balance_on) {
		this.high_voltage_balance_on = high_voltage_balance_on;
	}
	public String getHigh_voltage_team() {
		return high_voltage_team;
	}
	public void setHigh_voltage_team(String high_voltage_team) {
		this.high_voltage_team = high_voltage_team;
	}
	public Double getLow_voltage_balance() {
		return low_voltage_balance;
	}
	public void setLow_voltage_balance(Double low_voltage_balance) {
		this.low_voltage_balance = low_voltage_balance;
	}
	public Long getLow_voltage_balance_on() {
		return low_voltage_balance_on;
	}
	public void setLow_voltage_balance_on(Long low_voltage_balance_on) {
		this.low_voltage_balance_on = low_voltage_balance_on;
	}
	public String getLow_voltage_team() {
		return low_voltage_team;
	}
	public void setLow_voltage_team(String low_voltage_team) {
		this.low_voltage_team = low_voltage_team;
	}
	public Double getSoil_building_balance() {
		return soil_building_balance;
	}
	public void setSoil_building_balance(Double soil_building_balance) {
		this.soil_building_balance = soil_building_balance;
	}
	public Long getSoil_building_balance_on() {
		return soil_building_balance_on;
	}
	public void setSoil_building_balance_on(Long soil_building_balance_on) {
		this.soil_building_balance_on = soil_building_balance_on;
	}
	public String getSoil_building_team() {
		return soil_building_team;
	}
	public void setSoil_building_team(String soil_building_team) {
		this.soil_building_team = soil_building_team;
	}
	public Double getCity_building_balance() {
		return city_building_balance;
	}
	public void setCity_building_balance(Double city_building_balance) {
		this.city_building_balance = city_building_balance;
	}
	public Long getCity_building_balance_on() {
		return city_building_balance_on;
	}
	public void setCity_building_balance_on(Long city_building_balance_on) {
		this.city_building_balance_on = city_building_balance_on;
	}
	public String getCity_building_team() {
		return city_building_team;
	}
	public void setCity_building_team(String city_building_team) {
		this.city_building_team = city_building_team;
	}
	public Double getPipe_jacking_balance() {
		return pipe_jacking_balance;
	}
	public void setPipe_jacking_balance(Double pipe_jacking_balance) {
		this.pipe_jacking_balance = pipe_jacking_balance;
	}
	public Long getPipe_jacking_balance_on() {
		return pipe_jacking_balance_on;
	}
	public void setPipe_jacking_balance_on(Long pipe_jacking_balance_on) {
		this.pipe_jacking_balance_on = pipe_jacking_balance_on;
	}
	public String getPipe_jacking_team() {
		return pipe_jacking_team;
	}
	public void setPipe_jacking_team(String pipe_jacking_team) {
		this.pipe_jacking_team = pipe_jacking_team;
	}
	public Double getBalance_total() {

		if (balance_total == null) {
			double h = high_voltage_balance == null?0:high_voltage_balance.doubleValue();
			double l = low_voltage_balance == null?0:low_voltage_balance.doubleValue();
			double s = soil_building_balance == null?0:soil_building_balance.doubleValue();
			double c = city_building_balance == null?0:city_building_balance.doubleValue();
			double p = pipe_jacking_balance == null?0:pipe_jacking_balance.doubleValue();
			
			return new Double(h + l + s + c + p) ;
		}
		return balance_total;
	}
	public void setBalance_total(Double balance_total) {
		this.balance_total = balance_total;
	}
	public String getRemark_() {
		return remark_;
	}
	public void setRemark_(String remark_) {
		this.remark_ = remark_;
	}
	public Short getProgress_() {

		if (high_voltage_balance == null) {
			return 0 ;
		}
		if (low_voltage_balance == null) {
			return 0 ;
		}
		if (soil_building_balance == null) {
			return 0 ;
		}
		if (city_building_balance == null) {
			return 0 ;
		}
		if (pipe_jacking_balance == null) {
			return 0 ;
		}
		return 1;//已经结算
	}
	public void setProgress_(Short progress_) {
		this.progress_ = progress_;
	}
	public String getDevice_provider() {
		return device_provider;
	}
	public void setDevice_provider(String device_provider) {
		this.device_provider = device_provider;
	}
	public Double getBudget_total_diff() {
		return budget_total_diff;
	}
	public void setBudget_total_diff(Double budget_total_diff) {
		this.budget_total_diff = budget_total_diff;
	}
	
}
